package com.cskaoyan.servlet;

import com.cskaoyan.bean.PageData;
import com.cskaoyan.bean.vo.BaseRespVo;
import com.cskaoyan.common.CommonServlet;
import com.cskaoyan.service.RoleService;
import com.cskaoyan.service.impl.RoleServiceImpl;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @Author Pudding
 * @Date 2024/5/30 12:36
 */
@WebServlet("/admin/role/*")
public class AdminRoleServlet extends CommonServlet {

    RoleService roleService = new RoleServiceImpl();

    public BaseRespVo options(HttpServletRequest request, HttpServletResponse response) {
        //这里是get请求，且没有携带参数，所以我们就不用获取请求数据了

        //调用service来处理业务，这里获取响应报文中的data数据
        //这里data中的list数据，可以直接在service中处理获得
        PageData data = roleService.options();

        //返回响应报文中数据data
        return BaseRespVo.ok(data);
    }
}
